﻿<Window x:Class="LED.Show.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ld="clr-namespace:LEDManager;assembly=LEDManager"
        xmlns:db="clr-namespace:LEDDataBase;assembly=LEDDataBase"
        Title="MainWindow" Height="800" Width="1200"
        WindowStartupLocation="CenterScreen">
    <Grid>
        <TabControl>
            <TabItem Header="Contract">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="100"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="1*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <StackPanel  Grid.Row="0" Grid.Column="0">
                    <WrapPanel>
                        <Button Width="Auto" Height="Auto" Name="cmdLEDDef" Click="cmdLEDDef_Click">LED 定义</Button>
                        <Button Width="Auto" Height="Auto" Name="cmdBmpTest" Click="cmdBmpTest_Click">测试图片加载</Button>
                        <Button Width="Auto" Height="Auto" Name="cmdTextTest" Click="cmdTextTest_Click">测试文字加载</Button>
                    </WrapPanel>
                    <WrapPanel>
                        <Button Width="Auto" Height="Auto" Name="cmdInterfaceTest" Click="cmdInterfaceTest_Click">接口测试</Button>
                    </WrapPanel>
                    </StackPanel>
                    <StackPanel Grid.Row="1" Grid.Column="0">
                        <Expander Header=" 驱动">
                            <StackPanel>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0" Name="cmdInsigmaLEDDriver_Init" Content="Driver Init" Width="100" Click="cmdInsigmaLEDDriver_Init_Click"></Button>
                                    <TextBlock Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数: long InsigmaLEDDriver_Init( void );</TextBlock>
                                    <TextBlock Grid.Row="0" Grid.Column="2" TextWrapping="Wrap">初始化动态链接库</TextBlock>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入:</TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：1表示正常， -1表示出现异常。</TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button  Grid.Row="0" Grid.Column="0" Name="cmdInsigmaLEDDriver_Cleanup" Content="Driver Cleanup" Width="100" Click="cmdInsigmaLEDDriver_Cleanup_Click"></Button>
                                    <TextBlock Grid.Row="0" Grid.Column="1">long InsigmaLEDDriver_Cleanup( void );</TextBlock>
                                    <TextBlock  Grid.Row="0" Grid.Column="2">卸载动态链接库，将需要进行DLL卸载的代码放在这个函数里</TextBlock>
                                </Grid>
                            </StackPanel>
                        </Expander>
                        <Expander Header=" LED设备">
                            <StackPanel>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdIsDeviceOK" Content="IsDeviceOK" Width="100" Click="cmdLED_IsDeviceOK_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：long LED_IsDeviceOK( int nLEDID );</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：检测指定的屏幕显示设备是否正常运行；</TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入： 设备ID</TextBox>
                                        <TextBox Background="AliceBlue"  Name="txtDeviceID" Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：1表示正常， -1表示出现异常。</TextBox>
                                        <TextBox  Name="txtIsDeviceOK" Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="IsDeviceTurnOn" Content="IsDeviceTurnOn" Width="100" Click="IsDeviceTurnOn_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：long LED_IsDeviceTurnOn( int nLEDID )</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：查询远程显示设备是否打开；</TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入:设备ID</TextBox>
                                        <TextBox Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">成功返回0，失败返回-1。</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdSwitchPower"  Content="SwitchPower" Width="100" Click="cmdSwitchPower_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">long LED_SwitchPower( int nLEDID, int nTurnOn );</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">对远程显示屏设备进行开关控制</TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入： 设备ID;nTurnOn</TextBox>
                                        <TextBox Background="AliceBlue"    Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                        <TextBox Background="AliceBlue" Name="txtPower" Text="0" TextWrapping="Wrap" Width="50" />
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：1表示正常， -1表示出现异常。</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdSetBright"  Content="SetBright" Width="100" Click="cmdSetBright_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">long LED_SetBright( int nLEDID, long lValue );</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：设置远程显示屏的亮度</TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID lValue - 具体的亮度值</TextBox>
                                        <TextBox Background="AliceBlue"    Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                        <TextBox Background="Yellow"   Name="txtBright" Text="6" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：成功返回0，失败返回-1。</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdGetBright"  Content="GetBright" Width="100" Click="cmdGetBright_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">long LED_GetBright( int nLEDID);</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：获取远程显示屏的亮度值</TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID</TextBox>
                                        <TextBox Background="AliceBlue"    Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：long 获取到的亮度值</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                        <TextBox   Background="Yellow"    Text="6" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdRestart"  Content="Restart" Width="100" Click="cmdRestart_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：long LED_Restart( int nLEDID );</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：重启指定的远程显示屏设备，重启后如果显示屏内含有固化的帧就显示固化数据，否则不显示；
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID</TextBox>
                                        <TextBox Background="AliceBlue"    Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：成功返回0，失败返回-1.</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdAdjustCurrentTime"  Content="AdjustCurrentTime" Width="100" Click="cmdAdjustCurrentTime_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：int LED_AdjustCurrentTime( int nLEDID );</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：对指定的显示屏进行当前时间的校对，当显示屏显示的时间值不准确时，通过调用这个函数可以恢复当前精确时间
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID</TextBox>
                                        <TextBox Background="AliceBlue"    Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：成功返回0，失败返回-1.</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdGetFreeUploadBmpSpace"  Content="GetFreeUploadBmpSpace" Width="100" Click="cmdGetFreeUploadBmpSpace_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数： long LED_GetFreeUploadBmpSpace( int nLEDID ); (只对异步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能： 获取LED显示屏可以存储的剩余空间(以字节为单位)；
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID</TextBox>
                                        <TextBox Background="AliceBlue"    Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回： long 剩余字节数。</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdLEDScreenInit"  Content="LEDScreenInit" Width="100" Click="cmdLEDScreenInit_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：long LED_LEDScreenInit( int nLEDID, int nScreenType, int nWidth, int nHeight );
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：初始化指定的屏，做好添加帧数据的一切准备；
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID 
                                                                                           nScreenType - 屏幕类型 0:异步屏 1:同步屏
                                                                                            nWidth  - 要显屏的宽度
                                                                                            nHeight - 显示屏的高度
                                        </TextBox>
                                        <TextBox Background="AliceBlue"    Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：成功返回0，失败返回-1。</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdLEDClear"  Content="LEDClear" Width="100" Click="cmdLEDClear_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数： long LED_LEDClear( int nLEDID );
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能： 删除指定屏的所有数据(清屏操作)；
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入： nLEDID - 设备ID；
                                        </TextBox>
                                        <TextBox Background="AliceBlue"    Text="1" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBox  TextWrapping="Wrap">返回：成功返回0，失败返回-1。</TextBox>
                                        <TextBox   Text="0" Width="50" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                            </StackPanel>
                        </Expander>
                        <Expander Header="编辑">
                            <StackPanel>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="AddTextBlock" Content="AddTextBlock" Width="100" Click="AddTextBlock_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">long void LED_AddTextBlock(int nLEDID, string szText, LEDBlock rect, LEDFontDescriptor lpFont, int nEffectType, int nSpeed, Int32 lTrasnparent)</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能： 在当前节目内添加一个文字区块:</TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入 设备ID输入： nLEDID - 设备ID
                            szText - 要显示的字符串(不考虑分行，单行显示)
                            rect - 字符的显示区块
                            lpFont - 字体描述
                            nEffectType - 区块切入的效果
                            nSpeed - nEffectType>=2 and nEffectType
                            5 表示移动的速度，
                            nEffectType=6表示闪烁的频率
                            lTrasnparent - 字体是否透明(如果厂商支持则需要提供) 
                            1:透明 0:不透明
                                        </TextBox>

                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap">内容</TextBlock>
                                        <TextBox Background="AliceBlue"  Name="txtString" Text="大道本源西方金" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="AddBmpBlock" Content="AddBmpBlock" Width="100" Click="AddBmpBlock_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">void LED_AddBmpBlock( int nLEDID, const char *szBmpFile, LEDBlock destRect, LEDBlock sourceRect, int nEffectType, int nSpeed, long lTrasnparent );</TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：在当前节目内添加一个位图区块</TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID
      szBmpFile – 位图的文件名称
     destRect - 在屏幕上显示的目标矩形
      sourceRect - 截取的原图矩形
      nEffectType - 区块切入的效果
      nSpeed - nEffectType>=2 and nEffectType
                                5 表示移动的速度，nEffectType=6表示闪烁的频率
	  lTrasnparent - 位图是否透明(如果厂商支持则需要提供) 1:透明 0:不透明
                                        </TextBox>
                                        <TextBox Background="AliceBlue"  Name="txtBMP" Text="D:\SXDFile\A3.jpg" Width="Auto" TextWrapping="Wrap"></TextBox>
                                        <Image Height="55" Name="image1" Stretch="Fill" Width="110" Source="/LED.Show;component/Images/A3.jpg" />
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap">返回：无。</TextBlock>
                                        <TextBox Background="AliceBlue"   Text="0" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdPreUploadBMP" Content="PreUploadBMP" Width="100" Click="cmdPreUploadBMP_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数： int LED_PreUploadBMP( int nLEDID, const char *szBmpFile ); (只对异步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能： 预先将指定的位图数据上传到指定的LED显示屏的存储器；
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入： nLEDID - 设备ID szBmpFile - 位图的文件名；
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap">内容</TextBlock>

                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdRemoveUploadedBmp" Content="RemoveUploadedBmp" Width="100" Click="cmdRemoveUploadedBmp_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数： int LED_RemoveUploadedBmp( int nLEDID, const char *szBmpFile ); (只对异步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能： 删除LED显示屏存储器中的位图图片
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入： nLEDID - 设备ID szBmpFile - 位图的文件名；
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap">返回： 成功返回0，失败返回-1。</TextBlock>
                                        <TextBox Background="AliceBlue"  Name="txtszBmpFile" Text="A1.bmp" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdAddLine" Content="AddLine" Width="100" Click="cmdAddLine_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：void LED_AddLine( int nLEDID, int x0, int y0, int x1, int y1, unsigned long lColor );
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：当前节目内添加一条直线；
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">
                                            输入：nLEDID - 设备ID；
                                x0 - 开始X坐标；
                                y0 - 开始Y坐标；
                                x1 - 结束X坐标；
                                Y1 - 结束Y坐标；
                                lColor - 线条颜色；
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap">返回：无。</TextBlock>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdAddAnimationBlock" Content="AddAnimationBlock" Width="100" Click="cmdAddAnimationBlock_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：void LED_AddAnimationBlock(int nLEDID, const char *szPath, int nDir, LEDBlock rcRect ); (只对同步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：在当前节目内添加一个动画在(多帧图片)区域；
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">
                                            输入：	nLEDID - 设备ID；
                                szPath - 动画文件路径；
                                nDir - 0表示是将动画的多帧存放在szPath指定的同一个图片文件中(bmp,png,jpg等)
                                rcRect – 区域的大小范围
                                等于1表示动画文件由一系列图片文件组成，这些文件存放在szPath的指定目录下
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap">返回：无。</TextBlock>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdAddVideoBlock" Content="AddVideoBlock" Width="100" Click="cmdAddVideoBlock_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：void LED_AddVideoBlock( int nLEDID, const char *szPath, LEDBlock rcRect ); (只对同步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：在当前节目内添加一个视频区域
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">
                                            输入：nLEDID - 设备ID
                                szPath - 指定的视频文件
                                rcRect – 区域的大小范围
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap">返回：无。</TextBlock>
                                    </WrapPanel>
                                </Grid>
                            </StackPanel>
                        </Expander>
                        <Expander Header="节目管理">
                            <StackPanel>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="BeginProgram" Content="BeginProgram" Width="100" Click="BeginProgram_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">long LED_BeginProgram( int nLEDID,int nProgramID,long lDisplayTime );
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能： 通知指定设备号的LED显示屏，像该屏幕添加节目编号为nProgramID的节目，如果该节目已经存在，则相当于覆盖，如果不存在，则另外添加，即做到可以保持多个节目，根据指定的节目编号通过调用LED_RunProgram显示某一节目。
       在直到调用LED_EndProgram之前的所有区域添加函数的调用都将添加到最近的LED_BeginProgram调用所指定的节目里。</TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入： nLEDID - 设备ID  nFrameID – 节目ID编号   lDisplayTime - 该节目显示时间；
                                        </TextBox>
                                        <TextBlock>节目ID:</TextBlock>
                                        <TextBox Background="Yellow" Name="txtFrameID">01</TextBox>
                                        <TextBlock>显示时间:</TextBlock>
                                        <TextBox Background="Coral" Name="txtDisplayTime">20000</TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap"> 返回：成功返回0，失败返回-1。</TextBlock>
                                        <TextBox Background="AliceBlue"   Text="0" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdEndProgram" Content="EndProgram" Width="100" Click="cmdEndProgram_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">long LED_EndProgram( int nLEDID，int nProgramID );
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：通知指定的屏幕当前节目的编辑已经完成
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID
                                nProgramID - 节目编号ID
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap"> 返回：成功返回0，失败返回-1。</TextBlock>
                                        <TextBox Background="AliceBlue"   Text="0" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdSendToScreen" Content="SendToScreen" Width="100" Click="cmdSendToScreen_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">int LED_SendToScreen ( int nLEDID，int nProgramID ); (只对异步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：把当前组织形成的屏幕数据作为指定的节目编号发送到指定设备；结合3.15~3.22
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID
                                nProgramID - 节目编号ID
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap"> 返回：成功返回0，失败返回-1。</TextBlock>
                                        <TextBox Background="AliceBlue"   Text="0" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdDeleteProgram" Content="DeleteProgram" Width="100" Click="cmdDeleteProgram_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">int LED_DeleteProgram ( int nLEDID，int nProgramID ); (只对异步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：在指定的LED设备上删除指定编号为nProgramID的节目。
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID
                                nProgramID - 节目编号ID
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap"> 返回：成功返回0，失败返回-1。</TextBlock>
                                        <TextBox Background="AliceBlue"   Text="0" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdFastenProgram" Content="FastenProgram" Width="100" Click="cmdFastenProgram_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">long LED_FastenProgram( int nLEDID ) (只对异步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：把当前屏幕上的数据固化；用于保存掉电后，重上电的默认画面
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap"> 返回：成功返回0，失败返回-1。</TextBlock>
                                        <TextBox Background="AliceBlue"   Text="0" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                                <Grid>
                                    <Grid.RowDefinitions >
                                        <RowDefinition Height="1*"></RowDefinition>
                                        <RowDefinition Height="1*"></RowDefinition>
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="100"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                        <ColumnDefinition Width="1*"></ColumnDefinition>
                                    </Grid.ColumnDefinitions>
                                    <Button Grid.Row="0" Grid.Column="0"  Name="cmdRunProgram" Content="RunProgram" Width="100" Click="cmdRunProgram_Click"></Button>
                                    <TextBox Grid.Row="0" Grid.Column="1" TextWrapping="Wrap">函数：long LED_RunProgram( int nLEDID，int nProgramID ) (只对异步屏)
                                    </TextBox>
                                    <TextBox Grid.Row="0" Grid.Column="2"  TextWrapping="Wrap">功能：在指定设备上调用指定的节目单
                                    </TextBox>
                                    <WrapPanel Grid.Row="1" Grid.Column="1">
                                        <TextBox TextWrapping="Wrap">输入：nLEDID - 设备ID
nProgramID - 节目编号ID；
                                        </TextBox>
                                    </WrapPanel>
                                    <WrapPanel Grid.Row="1" Grid.Column="2">
                                        <TextBlock  TextWrapping="Wrap"> 返回：成功返回0，失败返回-1。</TextBlock>
                                        <TextBox Background="AliceBlue"   Text="0" Width="Auto" TextWrapping="Wrap"></TextBox>
                                    </WrapPanel>
                                </Grid>
                            </StackPanel>
                        </Expander>
                    </StackPanel>
                </Grid>
            </TabItem>
            <TabItem Header="Management">
                <ScrollViewer Height="Auto" HorizontalScrollBarVisibility="Auto"
                          VerticalScrollBarVisibility="Auto">
                    <ld:LEDManagement Width="Auto"></ld:LEDManagement>
                </ScrollViewer>
            </TabItem>
            <TabItem Header="DataBase">
                <ScrollViewer Height="Auto" HorizontalScrollBarVisibility="Auto"
                          VerticalScrollBarVisibility="Auto">
                    <db:ManageLEDDataBase></db:ManageLEDDataBase>
                </ScrollViewer>
            </TabItem>
        </TabControl>
    </Grid>
</Window>
